package com.ccys.cms.service.administrator.impl;


import com.ccys.cms.service.administrator.TblAuditTrailWebService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.administrator.TblAuditTrailDTO;
import com.ccys.db.entity.TblAuditTrail;
import com.ccys.db.mapper.TblAuditTrailMapper;
import com.ccys.db.page.PageUtils;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.administrator.TblAuditTrailDetailWebVO;
import com.ccys.db.vo.administrator.TblAuditTrailWebVO;

import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;


/**
 * tbl_audit_trail管理
 */
@Service
@Slf4j
public class TblAuditTrailWebServiceImpl extends BaseServiceImpl<TblAuditTrail> implements TblAuditTrailWebService {

    @Autowired(required = false)
    private TblAuditTrailMapper tblAuditTrailMapper;

    @Override
    public ResponseResult listObjectsCms(HttpServletRequest request, HttpServletResponse response, TblAuditTrailDTO dto) {
        PageUtils.startPage(request);
        List<TblAuditTrailWebVO> list = this.tblAuditTrailMapper.listObjectsCms(dto);
        PageInfo pageInfo = new PageInfo<>(list);
        return ResponseResult.success(pageInfo);
    }

    @Override
    public ResponseResult getTblAuditTrailDetail(HttpServletRequest request, HttpServletResponse response, TblAuditTrailDTO dto) {
        TblAuditTrailDetailWebVO detail = this.tblAuditTrailMapper.getTblAuditTrailDetail(dto);
        return ResponseResult.success(detail);
    }




}